/* GUI CONVERTED from relniq01.p (converter v1.75) Sat Aug 12 23:06:03 2000 */
/* relniq01.p - PRODUCTION LINE DETAIL INQUIRY                           */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                   */
/* All rights reserved worldwide.  This is an unpublished work.          */
/* web convert relniq01.p (converter v1.00) Thu Mar 05 16:04:18 1998 */
/* web tag in relniq01.p (converter v1.00) Thu Mar 05 16:04:01 1998 */
/*F0PN*/ /*K1KC*/ /*                                                    */
/*V8:ConvertMode=Report                                         */
/* REVISION: 7.0      LAST MODIFIED: 02/25/92       BY: SMM  *F230*/
/* REVISION: 7.0      LAST MODIFIED: 03/29/92       BY: emb  *F331*/
/* REVISION: 7.0      LAST MODIFIED: 05/22/92       BY: emb  *F530*/
/* Revision: 7.3        Last edit: 11/19/92             By: jcd *G339* */
/* REVISION: 7.3      LAST MODIFIED: 12/14/92       BY: emb  *G468*/
/* REVISION: 7.3      LAST MODIFIED: 04/28/93       BY: qzl  *GA53*/
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 03/05/98   BY: *K1KC* Beena Mol   */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan    */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb              */


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K1KC*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE relniq01_p_1 "Item Number"
/* MaxLen: Comment: */

&SCOPED-DEFINE relniq01_p_2 "Rate"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

     define variable line like ln_line.
     define variable site like ln_site.
     define variable part like pt_part.
     define variable start_date like lnd_start.

/*K1KC* /*GA53*/ {mfdtitle.i "b+ "} */

     
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
        site
        line
        part
        start_date
     with frame a width 80 no-underline attr-space THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



     /* SET EXTERNAL LABELS */
     setFrameLabels(frame a:handle).

/*F530*/ site = global_site.
/*GA53*/ part = global_part.

/*K1KC*/ {wbrp01.i}

     repeat:

/*K1KC*/ if c-application-mode <> 'web' then
         update site line part start_date with frame a editing:

           if frame-field = "site" then do:
          /* FIND/NEXT PREVIOUS */
          {mfnp.i si_mstr site si_site site si_site si_site}
          if recno <> ? then do:
             display si_site @ site with frame a.
          end.
          recno = ?.
           end.
           else if frame-field = "line" then do:
          /* FIND/NEXT PREVIOUS */
          {mfnp01.i ln_mstr line ln_line "input site" ln_site ln_line}
          if recno <> ? then do:
             display ln_line @ line
/*F530*              ln_site @ site */
             with frame a.
          end.
          recno = ?.
           end.
           else if frame-field = "part" then do:
          /* FIND/NEXT PREVIOUS */
          {mfnp05.i lnd_det lnd_line
          "lnd_site = input site and lnd_line = input line"
           lnd_part "input part"}
          if recno <> ? then do:
             display lnd_part @ part with frame a.
          end.
          recno = ?.
           end.
           else do:
          readkey.
          apply lastkey.
           end.
        end.  /* EDITING*/

/*K1KC*/ {wbrp06.i &command = update &fields = "  site line part start_date"
          &frm = "a"}

/*K1KC*/ if (c-application-mode <> 'web') or
/*K1KC*/ (c-application-mode = 'web' and
/*K1KC*/ (c-web-request begins 'data')) then do:

/*G468*/    /* Added section*/
        if site > "" then do:
           find si_mstr no-lock where si_site = site no-error.
           if not available si_mstr then do:
             {mfmsg.i 708 3}
/*K1KC*/     if c-application-mode = 'WEB' then return.
             undo, retry.
           end.
        end.

        if line > "" then do:
           find first ln_mstr no-lock where ln_line = line no-error.
           if not available ln_mstr then do:
             {mfmsg.i 8524 3}
/*K1KC*/     if c-application-mode = 'WEB' then return.
             undo, retry.
           end.

           find ln_mstr where ln_site = site
           and ln_line = line no-lock no-error.
           if not available ln_mstr then do:
             {mfmsg.i 8526 3}
/*K1KC*/     if c-application-mode = 'WEB' then return.
             undo, retry.
           end.
        end.

        if part > "" then do:
           find pt_mstr where pt_part = part no-error.
           if not available pt_mstr then do:
             {mfmsg.i 16 3}
/*K1KC*/     if c-application-mode = 'WEB' then return.
             undo, retry.
           end.
        end.
/*G468*/    /* End of added section */

/*G468*/    hide frame b.
/*G468*/    hide frame c.

/*K1KC*/ end.

           {mfselprt.i "terminal" 80}

/*G468*     for each ln_mstr no-lock where ln_line >= line
        and ln_site >= site: */

/*G468*/    for each ln_mstr no-lock where
/*G468*/    ln_site = (if site > "" then site else ln_site)
/*G468*/    and ln_line = (if line > "" then line else ln_line)
/*G468*/    and(part = ""
/*G468*/    or can-find (first lnd_det where lnd_line = ln_line
/*G468*/        and lnd_site = ln_site and lnd_part = part))
/*G468*/    by ln_site by ln_line with frame c:

                /* SET EXTERNAL LABELS */
                setFrameLabels(frame c:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                     /*G339*/

           display ln_site ln_line ln_desc no-label ln_rate label {&relniq01_p_2}
           with frame c side-labels width 80 STREAM-IO /*GUI*/ .

           for each lnd_det no-lock where lnd_line = ln_line
           and lnd_site = ln_site
           and lnd_part = (if part > "" then part else lnd_part)
           and (lnd_start >= start_date or start_date = ?)
/*G468*/       break by lnd_line by lnd_site by lnd_part
           with frame b:

                /* SET EXTERNAL LABELS */
                setFrameLabels(frame b:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                     /*G339*/

/*F530*/          find pt_mstr no-lock where pt_part = lnd_part no-error.

          display lnd_part column-label {&relniq01_p_1}
             lnd_start lnd_setup lnd_run lnd_tool
             lnd_rate @ ln_rate
/*F530*              lnd_prod_um */
          with frame b width 80 no-attr-space STREAM-IO /*GUI*/ .

/*F530*/          if available pt_mstr then display pt_um @ lnd_prod_um WITH STREAM-IO /*GUI*/ .

           end.
        end. /* FOR EACH */

        {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

        {mfmsg.i 8 1}

        if site <> "" then global_site = site.
        if part <> "" then global_part = part.

     end. /* REPEAT */

/*K1KC*/ {wbrp04.i &frame-spec = a}
